#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cstring>
using namespace std;
const int MAXN=1e6+7;
typedef long long ll;
const ll MOD=1e9+7;
bool is_prime[MAXN];
int prime[MAXN],p_cnt;
int mu[MAXN];
int sum[MAXN];
ll u[MAXN];
ll sum_j[MAXN];
ll he[MAXN];
void Init() {
	memset(is_prime, 1, sizeof(is_prime));
	mu[1]=1;
	u[1]=1;
	p_cnt=0;
	for (int i=2; i<MAXN; ++i) {
		if (is_prime[i]) {
			prime[p_cnt++]=i;
			mu[i]=-1;
			u[i]=2;
		}
		for (int j=0; j<p_cnt&&prime[j]*i<MAXN; ++j) {
			is_prime[i*prime[j]]=false;
			if (i%prime[j]==0) {
				mu[i*prime[j]]=0;
				int z=i;
				int cnt=1;
				while(z%prime[j]==0) {
					z=z/prime[j];
					++cnt;
				}
				u[i*prime[j]]=(u[z]*(cnt+1))%MOD;
				break;
			}
			else {
				mu[i*prime[j]]=-mu[i];
				u[i*prime[j]]=(u[i]*2)%MOD;
			}
		}
	}
	sum[0]=0;
	for (int i=1; i<MAXN; ++i) {
		sum[i]=sum[i-1]+mu[i];
	}
	sum_j[1]=1;
	for (int i=2; i<MAXN; ++i) {
		sum_j[i]=(sum_j[i-1]+u[i-1]+1)%MOD;
	}
	he[0]=0;
	for (int i=1; i<MAXN; ++i) {
		he[i]=(he[i-1]+sum_j[i])%MOD;
	}
}
ll get(ll ask) {
	ll res=0;
	ll last;
	for (int i=1; i<=ask; i=last+1) {
		last=ask/(ask/i);
		res=(res+(ll)(sum[last]-sum[i-1])*he[ask/i])%MOD;
	}
	if (res<0) res+=MOD;
	return res;
}
int main() {
	Init();
	ll ask;
	while (~scanf("%lld", &ask)) {
		printf("%lld\n", get(ask));
	}
	return 0;
}
